package com.nus.fellowmark.modules.assignment.controller;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

import com.nus.fellowmark.common.response.ServerResponseEntity;
import com.nus.fellowmark.modules.assignment.vo.FinalGradeVO;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.nus.fellowmark.entity.FinalGradeEntity;
import com.nus.fellowmark.modules.assignment.service.FinalGradeService;
import com.nus.fellowmark.common.utils.PageUtils;



/**
 * 
 *
 * @author Chen Ruoyi
 * @email chenruoyisz@gmail.com
 * @date 2023-09-03 20:18:08
 */
@RestController
@RequestMapping("/finalgrade")
public class FinalGradeController {
    @Autowired
    private FinalGradeService finalGradeService;

    @RequestMapping("/calculate/{assignmentId}")
    public ServerResponseEntity calculateFinalGrade(@PathVariable Integer assignmentId) {
        List<FinalGradeVO> finalGradeVOList = finalGradeService.calculateFinalGrade(assignmentId);
        return ServerResponseEntity.success(finalGradeVOList);
    }

}
